<?php require_once('Connections/adminOS2015.php'); ?>

<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$maxRows_Text = 10;
$pageNum_Text = 0;
if (isset($_GET['pageNum_Text'])) {
  $pageNum_Text = $_GET['pageNum_Text'];
}
$startRow_Text = $pageNum_Text * $maxRows_Text;

mysql_select_db($database_adminOS2015, $adminOS2015);
$query_Text = "SELECT id, text FROM admin_article ORDER BY id DESC";
$query_limit_Text = sprintf("%s LIMIT %d, %d", $query_Text, $startRow_Text, $maxRows_Text);
$Text = mysql_query($query_limit_Text, $adminOS2015) or die(mysql_error());
$row_Text = mysql_fetch_assoc($Text);

if (isset($_GET['totalRows_Text'])) {
  $totalRows_Text = $_GET['totalRows_Text'];
} else {
  $all_Text = mysql_query($query_Text);
  $totalRows_Text = mysql_num_rows($all_Text);
}
$totalPages_Text = ceil($totalRows_Text/$maxRows_Text)-1;
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>OFFICE OS</title>
<link href="css/normalize.css" rel="stylesheet" type="text/css">
<link href="Css/Admin.css" rel="stylesheet" type="text/css">

<script src="js/jquery-1.11.2.min.js" ></script>
</head>

<body>
   <?php include("Nav.php"); ?>
   <div class="R-box">
        <h1>新闻列表</h1>
        <div class="news">
        <ul>
        
        <li><span><a href="#">删除</a> | <a href="#">修改</a></span>1 动态新闻</li>

         
         
         
         
    
          <li id="list-no">上一页 下一页</li>
        </ul>
      </div>
</div>
<script>
 $(".L-box span").click(
		function(){
			if($(this).next("li").is(":hidden")) 
				{	
					$(".L-box span li ").slideUp(300);
					$(this).next("li").slideDown(300);
				}
			else
				{
					$(this).next("li").slideUp(300);
				};
		 });
   </script>
<table width="100%" border="0">
  <tbody>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <?php do { ?>
        <td><?php echo $row_Text['id']; ?></td>
        <td><?php echo $row_Text['text']; ?></td>
        <td>编辑|删除</td>
        <?php } while ($row_Text = mysql_fetch_assoc($Text)); ?>
    </tr>
  </tbody>
</table>
</body>
</html>
<?php
mysql_free_result($Text);
?>
